<?php
header("Content-type:text/html; charset=gbk;");

$config = include('config.php');

$redis = include('conn.php');

$action = isset($_GET["action"]) ? $_GET["action"] : "";
$p1 = isset($_GET['p1']) ? addslashes($_GET['p1']) : "";
$p2 = isset($_GET['p2']) ? addslashes($_GET['p2']) : "";
$p3 = isset($_GET['p3']) ? addslashes($_GET['p3']) : "";
$p4 = isset($_GET['p4']) ? addslashes($_GET['p4']) : "";
$p5 = isset($_GET['p5']) ? addslashes($_GET['p5']) : "";

if($action == "zAdd"){

	$result = $redis->zAdd($p1, $p2, $p3);
	var_dump($result);exit;
	
}else if($action == "zRange"){
	
	$result = $redis->zRange($p1, $p2, $p3, $p4);
	print_r($result);exit;
	
}else if($action == "zRevRange"){
	
	$result = $redis->zRevRange($p1, $p2, $p3, $p4);
	print_r($result);exit;
	
}else if($action == "zRangeByScore"){

	$result = $redis->zRangeByScore($p1, $p2, $p3);
	print_r($result);exit;
	
}else if($action == "zDelete"){
	
	$result = $redis->zDelete($p1, $p2);
	var_dump($result);exit;
	
}else if($action == "zSize"){
	
	$result = $redis->zSize($p1);
	var_dump($result);exit;
	
}else if($action == "zCount"){
	
	$result = $redis->zCount($p1, $p2, $p3);
	var_dump($result);exit;
	
}else if($action == "zScore"){
	
	$result = $redis->zScore($p1, $p2);
	var_dump($result);exit;
	
}else if($action == "zRank"){
	
	$result = $redis->zRank($p1, $p2);
	var_dump($result);exit;
	
}else if($action == "zIncrBy"){
	
	$result = $redis->zIncrBy($p1, $p2, $p3);
	var_dump($result);exit;
	
}else if($action == "zInter"){
	
	$result = $redis->zInter($p1, $p2);
	var_dump($result);exit;
	
}

?>
